package model;

import java.util.*;
import java.io.*;

public class IniUtil {

    // class that reads a settings.ini file which stores
    // our applications settings.
    public static String getProperty(String key) {
	String value = null;

	try {
	    Properties p = new Properties();
	    p.load(new FileInputStream("settings.ini"));
	    value = p.getProperty(key);

	} catch (Exception e) {
	    System.out.println(e);
	}

	return value;

    }

    public static void setProperty(String key, String value) {

	Properties p = new Properties();
	p.setProperty(key, value);

	FileOutputStream fout = null;

	try {
	    fout = new FileOutputStream("settings.ini");
	    p.store(fout, "Open Dialog");

	} catch (FileNotFoundException e) {
	    e.printStackTrace();

	} catch (IOException e) {
	    e.printStackTrace();
	}

    }
}
